package com.gxar.quick.ar.server.base.common.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author linsy
 * @version 1.0
 * @created 2023/11/18 09:31
 */
@Data
@Component
@ConfigurationProperties(prefix = "works")
@RefreshScope
public class WorksProperties {

    private final DraftProperties draftProperties;
    private final UserInfoProperties userInfoProperties;
    private final CreatorProperties creatorProperties;
    private final IdentifyProperties identifyProperties;

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "works.identify")
    @RefreshScope
    public static class IdentifyProperties {

        private List<Long> notCloudIdentifyUserId;

    }

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "works.creator")
    @RefreshScope
    public static class CreatorProperties {

        private String menuUrl;

    }


    @Data
    @Configuration
    @ConfigurationProperties(prefix = "works.draft")
    @RefreshScope
    public static class DraftProperties {

        private Integer limit;

    }

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "works.user")
    @RefreshScope
    public static class UserInfoProperties {
        /**
         * 默认用户id
         */
        private Long defaultUserId;
        /**
         * 默认手机号
         */
        private String defaultPhone;
    }

}
